Módulo:Juegos
local p = {} local games = { "AR" = "All Roads", "D20" = "Fallout Pen and Paper d20", "FO1" = "Fallout", "FO2" = "Fallout 2", "FO3" = "Fallout 3", "FO3OA" = "Operation: Anchorage", "FO3TP" = "The Pitt (add-on)", "FO3BS" = "Broken Steel", "FO3PL" = "Point Lookout (add-on)", "FO3MZ" = "Mothership Zeta (add-on)", "FNV" = "Fallout: New Vegas", "FNVGRA" = "Gun Runners' Arsenal", "FNVDM" = "Dead Money", "FNVHH" = "Honest Hearts", "FNVOWB" = "Old World Blues (add-on)", "FNVLR" = "Lonesome Road (add-on)", "FO4" = "Fallout 4", "FOS" = "Fallout Shelter", "FOT" = "Fallout Tactics", "FOT2" = "Fallout Tactics 2", "FOBOS" = "Fallout: Brotherhood of Steel", "FOBOS2" = "Fallout: Brotherhood of Steel 2", "PA" = "One Man, and a Crate of Puppets", "VB" = "Van Buren", "FILM" = "Fallout (film)", "FOX" = "Fallout Extreme", "JES" = "J.E. Sawyer's Fallout Role-Playing Game", "PV13" = "Project V13", "FB" = "Fallout Bible", "TAR" = "Project V13", "LH" = "Lionheart", } -- look up short title without disambig function stitle(game) local result = gamesgame if game ~= "FILM" then result = result:gsub('%s%(.*', '') end return result end -- -- -- This function, links, is for ordinary links within the body of -- -- an infobox. So if all you want returned is Fallout 4, then -- -- use the syntax: -- -- }}} -- -- -- function p.links(frame) local result = '' local game_list = mw.text.split(frame.args1, "%s*,%s*") for n, game in ipairs(game_list) do if game:lower() "none" then result = 'none' -- should probably be the empty string, but portable infoboxes can't hide the field else result = result .. '[.. games[game .. '|' .. stitle(game) .. ']]' if n ~= #game_list then result = result .. ' ' end end end return result end -- = -- -- The following functions are for the special use cases -- -- of a link to a particular "overview" page about an aspect -- -- of a game. These functions generate links in the title that -- -- take you to places like Fallout 2 locations or -- -- Fallout 3 characters. They are what used to be -- -- called around these parts "supertitle links". -- -- -- -- Title function -- -- This is a function that generically inserts a link into a supertitle. -- Either just to the game page itself or to a more specific page. -- -- gives just Fallout 4 -- results in Fallout 4 -- results in Fallout 4 weapon --> function p.title(frame) local result = '' local game_list = mw.text.split(frame.args1, "%s*,%s*") for n, game in ipairs(game_list) do if game:lower() "none" then result = 'Mentioned-only' if frame.args3 then result = result .. ' ' .. frame.args3 end else local link if frame.args2 then link = stitle(game) .. ' ' .. frame.args2 else link = gamesgame end local text = stitle(game) if frame.args3 and n #game_list then text = text .. ' ' .. frame.args3 end result = result .. '' .. text .. '' if n ~= #game_list then result = result .. ' / ' end end end return result end return p